import { Model, Post, Get, Put } from "~/utils/annotate";
import { GetDictResult, GetListResult, GetDictDataByIdResult, UpdateDictDataResult } from "./interface";

@Model('/system/dict/data')
export default class DictDataService {

    @Get('/list')
    getList(res) {
        return new GetListResult(res.code, res).result()
    }

    @Get('/:code')
    getDictDataById(res) {
        return new GetDictDataByIdResult(res.code, res).result()
    }

    @Post()
    insertDictData(res) {
        return new UpdateDictDataResult(res.code, res).result()
    }

    @Put()
    updateDictData(res) {
        return new UpdateDictDataResult(res.code, res).result()
    }

    @Get('/type/:dict')
    getDict(res) {
        return new GetDictResult(res.code, res).result()
    }
}